﻿<UserControl x:Class="VMClusterManager.VMDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    >
    <DockPanel>
        <!--Snapshots tree container-->
        <Expander DockPanel.Dock="Bottom" Header="Snapshots" BorderBrush="Black" BorderThickness="1">
            <HeaderedContentControl Header="Snapshots">
                <!--Snapshots Tree-->
                <TreeView ItemsSource="{Binding VMSnapshots}">
                    <TreeView.ItemContainerStyle>
                        <Style TargetType="{x:Type TreeViewItem}">
                            <Setter Property="FontWeight" Value="Normal" />
                            <Setter Property="IsExpanded" Value="True"/>
                            <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=OneWayToSource}"/>
                            <Style.Triggers>
                                <DataTrigger  Binding="{Binding IsLastApplied}" Value="True">
                                    <Setter Property="FontWeight" Value="Bold" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </TreeView.ItemContainerStyle>
                    <TreeView.ItemTemplate>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children, Mode=OneWay}">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding ElementName}"/>
                            </StackPanel>
                        </HierarchicalDataTemplate>
                    </TreeView.ItemTemplate>
                </TreeView>
            </HeaderedContentControl>
        </Expander>
       
        <Grid DockPanel.Dock="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="112*" />
                <ColumnDefinition Width="186*" />
            </Grid.ColumnDefinitions>
            <!--<StackPanel Grid.Column="1" Margin="10">
                <TextBlock>
                    <TextBlock.Text>
                        <Binding Path="VMName" />
                    </TextBlock.Text>
                </TextBlock>
                <TextBlock>
                    <TextBlock.Text>
                        <Binding Path="VMStatusString" Mode="OneWay" />
                    </TextBlock.Text>
                </TextBlock>
            </StackPanel>-->
            <Grid Grid.Column="1" Margin="10">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TextBlock Text="Name" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="{Binding VMName}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="Computer name" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="{Binding VMDomainName}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="Status" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="{Binding VMStatusString}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="OS name" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="{Binding OSName}" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="OS version" Grid.Column="0" Grid.Row="4" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="{Binding OSVersion}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="CSD Version" Grid.Column="0" Grid.Row="5" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="{Binding CSDVersion}" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="IP Address" Grid.Column="0" Grid.Row="6" HorizontalAlignment="Left" Margin="5"/>
                <TextBlock Text="{Binding IPv4Address}" Grid.Row="6" Grid.Column="1" HorizontalAlignment="Left" Margin="5"/>
            </Grid>

            <Image Grid.Column="0" Name="ThumbnailImage"  VerticalAlignment="Top" Source="{Binding ThumbnailImage}" Margin="10">
            </Image>
        </Grid>
    </DockPanel>
</UserControl>
